package io.github.eric.urpc.core.thread;

public class OrderedThreadKeyContext {
    private static final ThreadLocal<String> currentOrderedThreadKey;
    static {
        currentOrderedThreadKey = new InheritableThreadLocal<>();
    }

    public static void setCurrent(String orderedThreadKey) {
        currentOrderedThreadKey.set(orderedThreadKey);
    }

    public static String getCurrent() {
        return currentOrderedThreadKey.get();
    }

    public static void removeCurrent() {
        currentOrderedThreadKey.remove();
    }

}
